<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#div1 {width:200px; height:200px; background:#CCC; margin:100px; }
#div2 {width:100px; height:100px; background:red; position:absolute; left:50px; top:50px;}
</style>
<script>
window.onload=function ()
{
	var oDiv2=document.getElementById('div2');
	
	alert(oDiv2.offsetParent);
};
</script>
</head>

<body>
<div id="div1">
	<div id="div2"></div>
</div>
</body>
</html>
